Repository navigation
Feat: Open the toolkit-free AppKit window by default on macOS - #128
Merged
Merged
Conversation
The native-image renderer opened the AppKit window of its own only when DXC_APPKIT_WINDOW was set. macOS now always opens it, and the older arrangement of a second thread for the toolkit is gone from the C entry. The window takes what the application asks for in its first batch: title, size, minimum size, resizable, system or transparent title bar with a unified toolbar so the traffic lights share the bar's line, the icon, and a material behind the page. Files dropped on a FileDropTarget reach the node under them without the toolkit, with the full path list read outside the 96 byte event record. Pointer and accessibility coordinates are converted between points and pixels. The smoke test's auto exit is honoured. Covers FR-27 (file drop) and NFR-14. fr27_* tests in NativeFileDropTest and scripts/tests/macos-window-default.test.sh. Korean IME, VoiceOver and resize feel remain manual checks on a Mac.
… (NFR-14) An unattended macOS runner refuses TransformProcessType, and the window can still be made once the activation policy is set to regular. The refusal is reported instead of stopping the renderer.
A process told it has no display is given no clipboard by Compose desktop, so copy and paste in a text field went nowhere. The window now supplies the clipboard from its own pasteboard. The icon is passed as premultiplied RGBA bytes so that every desktop can read the same record.
This was referenced Oct 4, 2026
…debounce (FR-5) TextChanged was held back 120 ms after the last keystroke and restarted by every key, so a line echoing the typed text trailed the key by the pause plus a frame or two, and by the whole burst when typing was fast. Measured on the AppKit window with real key events posted to it: 152 ms from key to the echo being on screen, and the Host heard nothing during a burst. The first edit after a quiet period is now sent immediately, later ones are collapsed to at most one per interval carrying the latest text, and the last one is always sent. Covers the FR-5 criterion that the Host is notified of edits through a debounced TextChanged: bursts still collapse. Adds a test that a request for a frame is served by the next turn of the loop.
… not stretched (NFR-14) AppKit stays in its own tracking loop while an edge is dragged and only calls the view back, so the renderer's frame loop did not run: the layer's drawable size changed and the last frame was shown scaled to it. Measured with a scripted resize of 120 sizes: 0 frames presented and 120 sizes shown stretched. setFrameSize now sets the drawable size and asks the renderer for a frame at that size through the draw callback the Windows window already uses, a live resize presents with the window's transaction, and the layer anchors a stale drawable to its corner instead of scaling it. Same scripted resize after: 120 presented, 0 stale, 0 stretched, 6.1 ms per size on average. Also adds the aids used to measure it: DXC_REPORT_LATENCY timestamps from key to pixels, DXC_REPORT_RESIZE counts, DXC_SYNTH=type,keys,resize to drive the window from inside, and DXC_LEGACY_RESIZE to see the old behaviour. The counting is in appkit_resize.h and is tested without a window by scripts/tests/appkit-live-resize.test.sh.
… 120 ms throttle (FR-5) Typing in a field was held back by a 120 ms interval between notifications. An edit is now told to the Host on the next frame, carrying the text the field holds then, so keys inside one frame are one event and the last text is always sent. No measured reason for 120 ms was recorded anywhere in the repository.
Resuming from withFrameNanos goes back through the scene's dispatcher, so the send and the recomposition after it each cost a frame. Sent in the callback, the Host's batch is applied before the same frame is composed. Measured on macOS: key to on-screen echo 26 ms to 12.7 ms.
… feat/appkit-window-default
This was referenced Oct 4, 2026
Member
Author
|
For the record: the toolkit-free AppKit window from this PR lives in the Compose fork's extended/window (graalvm/graalvm-macos and native/macos). The parity measuring hooks for the Kotlin/Native macOS window landed there in thisisthepy/compose-multiplatform-core-extended#129; compose-rust #251 repins. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #124
Step 1 of 3 (toolkit-free windows by default). macOS now always opens
appkit_window.m's window;DXC_APPKIT_WINDOWis gone and there is no opt-out, since no test needs the toolkit window on macOS.What the window now carries from the toolkit's path: title, size, minimum size, resizable, system or transparent title bar (unified toolbar for the traffic light line), icon, backdrop material, file drop into FileDropTarget nodes (AWT-free registry, path list read outside the event record), auto exit for unattended runs, system dark following, caption strip measured from the window. Pointer and accessibility coordinates are converted between points and pixels (they were passed through unconverted, wrong at 200%). The C entry loses the toolkit's second-thread arrangement and the Objective-C title bar and material hooks that only served it.
Tests:
NativeFileDropTest(fr27_*),scripts/tests/macos-window-default.test.sh,desktop-c-symbols(Linux and Windows answer the new names).Needs a person on a Mac: Korean IME input, VoiceOver, live resize feel at 100% and 200%, traffic light line against the bar.